package com.reshare.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.reshare.base.BaseQuery;
import com.reshare.bean.Category;
import com.reshare.bean.CommodityImg;
import com.reshare.bean.User;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/*功能描述
 * @author ahm
 */
public class CommodityQuery extends BaseQuery {

    private String startTime;   // 日期范围：开始时间
    private String endTime;     // 日期范围：终止时间

    private Integer id;  // id
    private String title;  //商品标题
    private Double oldPrice;    // 原价
    private Double price;   // 现价
    private String quality; // 品质（九成新，使用时长）
    private Integer repertory;  // 库存数量
    private Integer clickCount = 0; // 浏览量
    private Integer collectCount = 0;   // 收藏数
    private Integer state;      // 商品状态（1，出售中；2，售罄；3，下架）
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publishDate;   // 发布时间
    private String coverImage;  // 商品封面
    private String serial;      // 商品编号
    private String description; // 商品描述
    private Boolean swiper;     // 是否为 轮播图

    private Category category;  // 商品分类
    private User user;      // 商品发布者
    private List<CommodityImg> commodityImgList;    // 商品图片列表

    public CommodityQuery() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Double getOldPrice() {
        return oldPrice;
    }

    public void setOldPrice(Double oldPrice) {
        this.oldPrice = oldPrice;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getQuality() {
        return quality;
    }

    public void setQuality(String quality) {
        this.quality = quality;
    }

    public Integer getRepertory() {
        return repertory;
    }

    public void setRepertory(Integer repertory) {
        this.repertory = repertory;
    }

    public Integer getClickCount() {
        return clickCount;
    }

    public void setClickCount(Integer clickCount) {
        this.clickCount = clickCount;
    }

    public Integer getCollectCount() {
        return collectCount;
    }

    public void setCollectCount(Integer collectCount) {
        this.collectCount = collectCount;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }

    public String getCoverImage() {
        return coverImage;
    }

    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Boolean getSwiper() {
        return swiper;
    }

    public void setSwiper(Boolean swiper) {
        this.swiper = swiper;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<CommodityImg> getCommodityImgList() {
        return commodityImgList;
    }

    public void setCommodityImgList(List<CommodityImg> commodityImgList) {
        this.commodityImgList = commodityImgList;
    }

    @Override
    public String toString() {
        return "Commodity{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", oldPrice=" + oldPrice +
                ", price=" + price +
                ", quality='" + quality + '\'' +
                ", repertory=" + repertory +
                ", clickCount=" + clickCount +
                ", collectCount=" + collectCount +
                ", state=" + state +
                ", publishDate=" + publishDate +
                ", coverImage='" + coverImage + '\'' +
                ", serial='" + serial + '\'' +
                ", description='" + description + '\'' +
                ", swiper=" + swiper +
                ", category=" + category +
                ", user=" + user +
                ", commodityImgList=" + commodityImgList +
                '}';
    }
}
